source config-list

podman network rm tbase
podman network create --subnet=10.89.0.0/16 -d bridge tbase


count=10
index=0
for name in $list
do
  echo "podman stop tbase-${name}"
  podman stop tbase-${name}
  echo "podman rm tbase-${name}"
  podman rm tbase-${name}
  echo "podman run tbase-${name}  ip=10.89.0.${count}"
  podman run  --privileged=true --network tbase --hostname ${name} --ip 10.89.0.${count} ${portlist[$index]} -itd --name tbase-${name}  localhost/tbase:2.5.0
  podman cp configs/createUser.sh tbase-${name}:/createUser.sh
  #podman exec tbase-${name} sh -c "ssh-keygen -t rsa"
  #podman cp tbase-${name}:/root/.ssh/idrsa.pub idrsa-${name}.pub 
  #cat idrsa-${name}.pub >> authorized_keys
  count=$((${count} + 1))
  index=$((${index} + 1))
done

#chmod 700 -R ~/.ssh
#chmod 600 ~/.ssh/authorized_keys 
